package com.example.friend.controller.user;

import com.example.common.core.Controller.BaseController;
import com.example.common.core.domin.PageQueryDTO;
import com.example.common.core.domin.R;
import com.example.common.core.domin.TableDataInfo;
import com.example.friend.service.user.IUserMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/message")
public class UserMessageController extends BaseController {

    @Autowired
    private IUserMessageService userMessageService;

    @GetMapping("/list")
    public TableDataInfo list(PageQueryDTO dto) {
        return userMessageService.list(dto);
    }

    @PutMapping("/DeleteMessage")
    public R<Void> DeleteMessage(Long textId) {
        System.out.println(textId);
        return toR(userMessageService.deleteMessage(textId));
    }

}
